package server;

import client.ClientLogic;
import client.Transport;
import client.TransportException;

/**
 * Created by zurdan on 27.11.14.
 */
public class StressTest2 {
    public static void main(String[] args) throws InterruptedException {
        for (int i = 0; i < 1000; i++) {
            final int finalI = i;
            new Thread(() -> {
                try {
                    Transport transport = new Transport(ClientLogic.IP, ClientLogic.PORT);
                    transport.request("/reg user" + finalI + " 123");
                    transport.request("/chid user" + finalI + " 123");
                    Thread.sleep(100);
                    for (int j = 0; j < 100; j++) {
                        transport.request("/snd message" + j +". Lol.");
                        Thread.sleep(10000);
                    }

                } catch (TransportException | InterruptedException e) {
                    e.printStackTrace();
                }
            }).start();
            Thread.sleep(100);
        }
    }
}
